﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Enlightener.Engine;
using Enlightener.Engine.Structs__Enums___Interfaces;
using Mono.Cecil;

namespace MDWorker.Structs__Enums___Interfaces
{
    public abstract class IMetadataWorker
    {
        public AssemblyDefinition MDAsm;
        public IDeobfuscator MainDeobfuscator;
        public List<MetadataTask> TaskQueue;

        protected IMetadataWorker(IDeobfuscator mainDeobfuscator)
        {
            MainDeobfuscator = mainDeobfuscator;
            MDAsm = AssemblyDefinition.ReadAssembly(DeobfuscatorContext.InPath);

            CreateTaskQueue();
        }

        public abstract void CreateTaskQueue();

        public virtual void BeginWork()
        {
            foreach (var task in TaskQueue)
                task.PerformTask();
        }
    }
}
